import request from "@/utils/request";

// 查询消防系统列表
export function listSystem(query) {
  return request({
    url: "/manager/device/systemList",
    method: "get",
    params: query,
  });
}

// 新增消防系统
export function postSystem(data) {
  return request({
    url: `/manager/device/saveSystem/?name=${data.name}`,
    method: "post",
    // data,

  });
}

// 修改消防系统
export function updateSystem(data) {
  return request({
    url: "/manager/device/editSystem",
    method: "put",
    data: data,
  });
}

// 删除消防系统
export function delSystem(id) {
  return request({
    url: "/manager/device/deleteSystem/" + id,
    method: "delete",
  });
}

//获取检查标准列表
export function getStandardList(params) {
  return request({
    url: "/system/dict/data/list",
    method: "get",
    params,
  });
}

//查询消防设备列表
export function listDevice(params) {
  return request({
    url: "/manager/device/deviceList",
    method: "get",
    params,
  });
}

// 新增消防设备
export function postDevice(data) {
  return request({
    url: "/manager/device/saveDevice",
    method: "post",
    data,
  });
}

// 修改消防设备
export function updateDevice(data) {
  return request({
    url: "/manager/device/editDevice",
    method: "put",
    data,
  });
}

// 修改消防设备参考视频
export function updateDeviceVideo(data) {
  return request({
    url: "/manager/device/update/video",
    method: "post",
    data,
  });
}

// 删除消防设备参考视频
export function deleteDeviceVideo(data) {
  return request({
    url: "/manager/device/delete/video",
    method: "post",
    data,
  });
}

// 删除消防设备
export function delDevice(id) {
  return request({
    url: "/manager/device/deleteDevice/" + id,
    method: "delete",
  });
}

// 检查项列表
export function listItem(deviceId) {
  return request({
    url: "/manager/item/list/" + deviceId,
    method: "get",
  });
}

// 新增检查项
export function postItem(data) {
  return request({
    url: "/manager/item",
    method: "post",
    data,
  });
}

// 修改检查项
export function updateItem(data) {
  return request({
    url: "/manager/item",
    method: "put",
    data,
  });
}

// 删除检查项
export function delItem(ids) {
  return request({
    url: "/manager/item/" + ids,
    method: "delete",
  });
}

// 获取常见检查问题列表
export function listProblem(params) {
  return request({
    url: "/manager/record/problem/list",
    method: "get",
    params
  });
}

// 新增常见检查问题
export function addProblem(data) {
  return request({
    url: "/manager/record/problem",
    method: "post",
    data
  });
}

// 修改常见检查问题
export function updateProblem(data) {
  return request({
    url: "/manager/record/problem",
    method: "put",
    data
  });
}

// 删除常见检车问题
export function delProblem(ids) {
  return request({
    url: `/manager/record/problem/${ids}`,
    method: "delete"
  });
}

// 查询巡检频次表
export function listByInspection(params) {
  return request({
    url: "/manager/device/listByInspection",
    method: "get",
    params
  });
}

// 查询特殊模式设备列表
export function listByCalculation(params) {
  return request({
    url: "/manager/device/calculationSettings/list",
    method: "get",
    params
  });
}

// 添加特殊模式设备列表
export function calcDeviceList(params) {
  return request({
    url: "/manager/device/calculationSettings/addList",
    method: "get",
    params
  });
}
// 添加特殊模式设备
export function calcDeviceAdd(data) {
  return request({
    url: "/manager/device/calculationSettings/add",
    method: "post",
    data
  });
}

// 删除特殊模式设备
export function calcDeviceDelete(data) {
  return request({
    url: "/manager/device/calculationSettings/delete",
    method: "post",
    data
  });
}